layui.config({
    base: '/static/js/lib',
    version: new Date().getTime()
}).use(['layer', 'element', "form"], function () {
    $ = layui.jquery;
    var form = layui.form;
    form.on('submit(editCate)', function (data) {
        $.post("/courseCate/save", $('.layui-form').serialize(), function (res) {
            if (res.code == "00000") {
                layer.msg("保存成功", {
                    icon: 6, time: 1500, end: function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }
                });
            } else {
                layer.msg("保存失败", {
                    icon: 6, time: 1500, end: function () {
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    }
                });
            }
        });
        return false;
    });
});